package com.neuedu.jdboot.common;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @author chens
 *
 * @param <E>
 */
public class DataTableResult<E> implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7560343018107386805L;
	/**
	 * 每次刷新数据，datatable会把该值累加1，用于识别数据的版本
	 */
	private Integer draw;
	/**
	 * 记录总数
	 */
	private Integer recordsTotal;
	/**
	 * 搜索记录总数
	 */
	private Integer recordsFiltered;

	/**
	 * 查询返回的数据
	 */
	private List<E> data;

	public Integer getDraw() {
		return draw;
	}

	public void setDraw(Integer draw) {
		this.draw = draw;
	}

	public Integer getRecordsTotal() {
		return recordsTotal;
	}

	public void setRecordsTotal(Integer recordsTotal) {
		this.recordsTotal = recordsTotal;
	}

	public Integer getRecordsFiltered() {
		return recordsFiltered;
	}

	public void setRecordsFiltered(Integer recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}

	public List<E> getData() {
		return data;
	}

	public void setData(List<E> data) {
		this.data = data;
	}

	public DataTableResult() {
		super();
	}

	public DataTableResult(Integer draw, Integer recordsTotal, Integer recordsFiltered, List<E> data) {
		super();
		this.draw = draw;
		this.recordsTotal = recordsTotal;
		this.recordsFiltered = recordsFiltered;
		this.data = data;
	}

	@Override
	public String toString() {
		return "DataTableResult [draw=" + draw + ", recordsTotal=" + recordsTotal + ", recordsFiltered="
				+ recordsFiltered + ", data=" + data + "]";
	}

}
